import type { BackgroundSetting, GeneralSetting } from '@/api/types/Setting.ts'
import { httpClient } from '@/config'

/**
 * 获取背景设置
 */
export function getBackgroundSetting() {
    return httpClient.send<BackgroundSetting>({
        url: '/account/setting/background',
        method: 'GET',
    })
}

/**
 * 设置背景设置
 */
export function setBackgroundSetting(data: BackgroundSetting) {
    return httpClient.send<BackgroundSetting>({
        url: '/account/setting/background',
        method: 'PUT',
        data,
    })
}

/**
 * 获取通用设置
 */
export function getGeneralSetting() {
    return httpClient.send<GeneralSetting>({
        url: '/account/setting/general',
        method: 'GET',
    })
}

/**
 * 设置通用设置
 */
export function setGeneralSetting(data: GeneralSetting) {
    return httpClient.send<GeneralSetting>({
        url: '/account/setting/general',
        method: 'PUT',
        data,
    })
}
